* Table 93 - Sensitivity to OOP
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual18.dta" // 8
append using "Counterfactuals Stata Files/Counterfactual19.dta" // 9
append using "Counterfactuals Stata Files/Counterfactual20.dta" // 3
append using "Counterfactuals Stata Files/Counterfactual21.dta" // 4
append using "Counterfactuals Stata Files/Counterfactual24.dta"  // 2 
append using "Counterfactuals Stata Files/Counterfactual16.dta"
append using "Counterfactuals Stata Files/Counterfactual22.dta"

replace experiment=0 if experiment ==16 
replace experiment=2 if experiment ==24
replace experiment=3 if experiment ==20 
replace experiment=4 if experiment ==21
replace experiment=8 if experiment ==18
replace experiment=9 if experiment ==19
replace experiment=10 if experiment ==22


label define explab 0 "Benchmark" 1 "Zero OOP ages<65" 2 "All have OOP of insured" 3 "OOP are 10% higher" 4 "OOP are 10% lower" 5 "No free care" 6 "All can treat if pay only" 7 "All must treat and pay" 8 "Cons floor 10% higher (singles)" 9 "Cons floor 20% higher (singles)" 10 "Double prob of Good Job" 11 "No Free Care (and loss of access)"
label values experiment explab

keep if experiment==0 | experiment==2 | experiment==3 | experiment==4  | experiment==8  | experiment==9 | experiment==10

keep if age<65
gen time_period = age-25
generate discounting_factor=0.956937799^(time_period)  
gen discounted_earnings=earnings*discounting_factor
bysort experiment ID: egen earnings_PV = total(discounted_earnings)
replace earnings_PV=. if age!=25
replace earnings_PV=earnings_PV/1000

gen I_good_H=1 if H==3
replace I_good_H=0 if H!=3

gen COV=.
tostring COV, replace
foreach num of numlist 0 2 3 4 8 9 10{
inequal7 earnings_PV if experiment==`num'
replace COV=r(cov) if experiment==`num'
}

gen COV_educ=.
tostring COV_educ, replace
foreach num of numlist 0 2 3 4 8 9 10{
	foreach educ of numlist 1 2 3{
inequal7 earnings_PV if experiment==`num' & education==`educ'
replace COV_educ=r(cov) if experiment==`num' & education==`educ'
}
}

destring COV , replace
destring COV_educ , replace

tab I_pay if type2!=1 & I_treat==1
tab tr_pay_alt if type2!=1 & I_treat==1
replace I_pay=. if type2==1 | I_treat==0

preserve
collapse (mean) I_treat I_pay TR I_good_H employed_yn earnings_PV COV , by(experiment )
gen education=0
sort education experiment
save "Temp\PV Earnings Variation.dta", replace
restore 

* by education
collapse (mean) I_treat I_pay  TR I_good_H employed_yn earnings_PV  COV_educ, by(experiment education) 
rename COV_educ COV
sort education experiment
append using "Temp\PV Earnings Variation.dta"

order experiment education I_treat I_pay I_good_H employed_yn TR earnings_PV  COV
replace I_treat=I_treat*100
replace I_pay=I_pay*100
replace I_good_H=I_good_H*100
replace employed_yn = employed_yn*100
replace  TR=TR*100

keep if education == 0 | education==1

sort education, stable
* OPEN DATA, COPY PASTE INTO TABLE. ALL NUMBERS IN ORDER
}



* Table 94 - Sensitivity to Treatment/Payment
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta" // 8
append using "Counterfactuals Stata Files/Counterfactual10.dta" // 5
append using "Counterfactuals Stata Files/Counterfactual8.dta" // 6
append using "Counterfactuals Stata Files/Counterfactual13.dta" // 7
append using "Counterfactuals Stata Files/Counterfactual22.dta" // 10
append using "Counterfactuals Stata Files/Counterfactual30.dta"  // 11

replace experiment=0 if experiment ==16 
replace experiment=1 if experiment ==10
replace experiment=2 if experiment ==30 
replace experiment=3 if experiment ==8
replace experiment=4 if experiment ==13
replace experiment=5 if experiment ==22


keep if age<65
gen time_period = age-25
generate discounting_factor=0.956937799^(time_period)  
gen discounted_earnings=earnings*discounting_factor
bysort experiment ID: egen earnings_PV = total(discounted_earnings)
replace earnings_PV=. if age!=25
replace earnings_PV=earnings_PV/1000

gen I_good_H=1 if H==3
replace I_good_H=0 if H!=3

gen COV=.
tostring COV, replace
foreach num of numlist 0 1 2 3 4 5 {
inequal7 earnings_PV if experiment==`num'
replace COV=r(cov) if experiment==`num'
}

gen COV_educ=.
tostring COV_educ, replace
foreach num of numlist 0 1 2 3 4 5 {
	foreach educ of numlist 1 2 3{
inequal7 earnings_PV if experiment==`num' & education==`educ'
replace COV_educ=r(cov) if experiment==`num' & education==`educ'
}
}

destring COV , replace
destring COV_educ , replace

tab I_pay if type2!=1 & I_treat==1
tab tr_pay_alt if type2!=1 & I_treat==1
replace I_pay=. if type2==1 | I_treat==0

preserve
collapse (mean) I_treat I_pay TR I_good_H employed_yn earnings_PV COV , by(experiment )
gen education=0
sort education experiment
save "Temp\PV Earnings Variation.dta", replace
restore 

* by education
collapse (mean) I_treat I_pay  TR I_good_H employed_yn earnings_PV  COV_educ, by(experiment education) 
rename COV_educ COV
sort education experiment
append using "Temp\PV Earnings Variation.dta"

order experiment education I_treat I_pay I_good_H employed_yn TR earnings_PV  COV
replace I_treat=I_treat*100
replace I_pay=I_pay*100
replace I_good_H=I_good_H*100
replace employed_yn = employed_yn*100
replace  TR=TR*100

keep if education == 0 | education==1
sort education, stable
drop if experiment==5
* OPEN DATA, COPY PASTE INTO TABLE. ALL NUMBERS IN ORDER

}



* Table 95 
qui{
* (note that medical costs need to be multiplied by 1.05. this was done in the fortran code so the code was run with the correct medical costs, but we didn't print MC*1.05 to file when writing data, we just wrote MC.)

* First panel: Average expenses
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta"
replace experiment=0 if experiment==16
append using "Counterfactuals Stata Files/Counterfactual23.dta"
keep if age<65

*generate table as follows:
*total MC*.6 / person
*total MC*6 if treated / person 
* paid by OOP/person 
* paid by ESHI
* paid by Public 
* Unpaid


* OOP paid by individuals
gen col3= OOP if tr_pay_alt==1 
replace col3=OOP if type2==1 & govt_transfer==0  
replace col3= OOP-govt_transfer if govt_transfer<OOP & govt_transfer>0 & tr_pay_alt==2

* What ESHI pays
gen col4= MC*.6*1.05 - OOP if I_treat==1 & ESHI==1 


* Public: Medicaid and DI (not the Universal Health insurance)
gen col5=OOP  if tr_pay_alt==2 
* Medicaid only pays some of OOP when the person can afford the rest
replace col5 =  govt_transfer if govt_transfer<OOP &  tr_pay_alt==2

* Unpaid bills
gen col6 =OOP if tr_pay_alt==3 


* Costs if all treated
gen col7=OOP if tr_pay_alt==4 & experiment==0 & ESHI==0 
replace col7=MC_orig*.6*1.05 if tr_pay_alt==4 & experiment==0 & ESHI==1  
replace col7=MC_orig*.6*1.05  if tr_pay_alt==4 & experiment==23 

* Universal health insurance 
gen col8=MC_orig *.6*1.05 - OOP if ((I_treat==1 & ESHI==0) | (type2==1 & ESHI==0 ) ) & experiment==23
gen col9=MC_orig *.6*1.05 - OOP if (I_treat==1 & ESHI==0)  & experiment==23

gen count=1

* Calculate statistics for all, for benchmark and UHI experiment
collapse (sum) col*  count, by(experiment)
replace col3=col3/count
replace col4=col4/count
replace col5=col5/count
replace col6=col6/count
replace col7=col7/count
replace col8=col8/count
replace col9=col9/count
drop count


label var col3 "OOP (Self)"
label var col4 "ESHI"
label var col5 "Medicaid"
label var col6 "Unpaid"
label var col7 "Untreated"
label var col8 "Public Insurance"
label var col9 "Public Insurance - No Preventive"

gen total= col3 + col4 + col5 + col6 if experiment==0
replace total= col3 + col4 + col5 + col6 + col8 if experiment==23
label var total "Total if treated"

table  (experiment) ,  statistic(mean col3 col4 col5 col6 col8 col9 total col7)  nototals nformat(%5.0f)  

collapse (mean) col3 col4 col5 col6 col8 col9 total col7, by (experiment)
sort experiment 
drop col9 
order experiment  col8  col3 col4 col5 col6  total  col7

* Open data and copy paste in Table 8. All columns and rows are in order

sort experiment
save "Temp\Table_UHI.dta", replace	
}

* Second panel: Health outcomes
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta"
replace experiment=0 if experiment==16
append using "Counterfactuals Stata Files/Counterfactual23.dta"

bysort experiment ID: egen max_age=max(age)
replace max_age=max_age+1 // die at the beginning of next year
replace max_age=. if age>25 // we want one obs per person

keep if age<65

gen I_shock=0 
replace I_shock=1 if type2!=1 

gen I_Good=0 
replace I_Good=1 if H==3

* these are the numbers in panel 2
table experiment, stat(mean  I_treat I_shock I_Good max_age)

collapse (mean) I_treat I_shock I_Good max_age , by (experiment)

* OPEN DATA 
* THESE ARE ALL THE STATISTICT FOR PANEL 2 OF TABLE 8. (need to transpose, but they are in order)

sort experiment
merge experiment using "Temp\Table_UHI.dta"	
drop _merge
sort experiment
save "Temp\Table_UHI.dta", replace	
}

* Third panel: Labor Market outcomes
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta"
replace experiment=0 if experiment==16
append using "Counterfactuals Stata Files/Counterfactual23.dta"

bysort experiment ID: egen max_age=max(age)
replace max_age=max_age+1 // die at the beginning of next year
replace max_age=. if age>25 // we want one obs per person

rename education college_alt
sort age college_alt
merge age college_alt using "${mystart}\CPS\CPS Data Files\Intermediate Data Files/Equiv.dta"

rename college_alt education
replace equiv= 1.5 if age>64
replace equiv= 1.5 + (equiv -2.0 )*0.3 if age<65

gen family_consumption = consumption
replace consumption = consumption/ equiv if married==1

gen time_period = age-25
generate discounting_factor=0.956937799^(time_period)  
gen discounted_family_consumption = family_consumption*discounting_factor
bysort experiment ID: egen family_consumption_PV = total(discounted_family_consumption)
replace family_consumption_PV=. if age!=25
replace family_consumption_PV=family_consumption_PV/1000


gen discounted_earnings=earnings*discounting_factor
bysort experiment ID: egen earnings_PV = total(discounted_earnings)
replace earnings_PV=. if age!=25
replace earnings_PV=earnings_PV/1000

* FT yrs of work
bysort experiment ID: egen yrs_work=max(human_capital_prime) 
replace  yrs_work=. if age!=25 // want only 1 obs per ID

* these are the numbers in panel 3
table experiment if age<65, stat(mean wage_offer employed_yn yrs_work family_consumption_PV earnings_PV TR) stat(cv family_consumption_PV earnings_PV)

* construct table for convenience
keep if age<65
collapse (mean) wage_offer employed_yn yrs_work family_consumption_PV earnings_PV TR (sd) CV_cons=family_consumption_PV CV_earn=earnings_PV , by (experiment)

replace CV_cons =CV_cons/family_consumption_PV // calculate coeff of variation for consumption
replace CV_earn =CV_earn/earnings_PV // calculate coeff of variation for earnings

order experiment wage_offer employed_yn yrs_work earnings_PV CV_earn family_consumption_PV CV_cons  TR

* OPEN DATA 
* THESE ARE ALL THE STATISTICT FOR PANEL 3 OF TABLE 8. (need to transpose, but they are in order)

sort experiment
merge experiment using "Temp\Table_UHI.dta"	
drop _merge
sort experiment
save "Temp\Table_UHI.dta", replace	
}

* Fourth panel: Gov revenue and expenditures per working age male
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta"
replace experiment=0 if experiment==16
append using "Counterfactuals Stata Files/Counterfactual23.dta"

keep if age<65

* revenue from UHI premiums
gen UHI_premium=0
replace UHI_premium = 810  if age<65 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) 

gen expenditures = Expenditures_pay if (I_treat==1 & I_pay==1) | type2==1 
replace expenditures = Expenditures_not_pay if I_pay==0
sum expenditures
* expenditures = OOP + tax paid + premiums
* first subtract premiums
*has ESHI
gen Income_tax= expenditures
replace Income_tax= expenditures - 810 if age<=64 &  (offer_accepted==3 | offer_accepted==5) &  Spouse_status!=3 // has eshi and spouse not covered or no spouse. 
replace Income_tax= expenditures - 2071 if age<=64 & (offer_accepted==3 | offer_accepted==5) &  Spouse_status==3
* experiment
replace Income_tax= expenditures - 810 if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) &  Spouse_status!=3
replace Income_tax= expenditures - 810*2 if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) &  Spouse_status==3
* now subtract the spouse's OOP
replace Income_tax= Income_tax-OOP_spouse if married==1
* now subtract own OOP - only for those who treat and pay. 
replace Income_tax= Income_tax - OOP if type2==1 | (I_treat==1 & I_pay==1) //these always pay

gen Cons_tax = consumption * .057
gen Total_tax = Income_tax + Cons_tax

replace spouse_income=0 if spouse_income==.
replace I_treat=1 if type2==1
replace I_pay=1 if type2==1 & ESHI==1 
replace I_pay=1 if type2==1 & ESHI==0 & experiment==23 

* In the benchmark, we need to worry about ESHI and ESHI premiums
* add the ESHI premium to expenditures = 810
* ESHI premium for couples is 2071
gen gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse - 1.045*assets - earnings - spouse_income if age<=64 & experiment==0 & (offer_accepted!=3 & offer_accepted!=5) // NO INSURANCE, BENCHMARK

* for those with ESHI
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + 810  - 1.045*assets - earnings if age<=64  & (offer_accepted==3 | offer_accepted==5) & married==0 
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse +  810  - 1.045*assets - earnings - spouse_income if age<=64 & (offer_accepted==3 | offer_accepted==5) &  Spouse_status==2
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse + 2071 - 1.045*assets - earnings - spouse_income  if age<=64  & (offer_accepted==3 | offer_accepted==5) & married==1 & Spouse_status==3

* UNINSURED IN EXPERIMENT
* experiment with UHI - now have to include total expenditures rather than OOP
* NOTE WE DON'T WANT TO SUBTRACT THE UHI PREMIUMS BECAUSE WE WANT THESE PREMIUMS TO COUNT AS PART OF THE GOV REVENUE
* no ESHI
* singles
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05  - 1.045*assets - earnings if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==0
* married
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05 + OOP_spouse  - 1.045*assets - earnings - spouse_income if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==1 &  Spouse_status==2  // spouse does not work
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05 + OOP_spouse + 810 - 1.045*assets - earnings - spouse_income if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==1 &  Spouse_status==3  // spouse works


gen Unpaid_bills=0
replace Unpaid_bills=OOP if tr_pay_alt==3 & age<65

gen UHI=0
replace UHI=MC_orig *.6*1.05 - OOP if ((I_treat==1 & ESHI==0) | (type2==1 & ESHI==0 ) ) & experiment==23 & age<65


collapse (mean) Total_tax UHI_premium UHI govt_transfer  Unpaid_bills gov_expenditure, by(experiment)
* OPEN DATA 
* THESE ARE THE NUMBERS IN THE BOTTOM PANEL OF THE TABLE (transposed)

sort experiment
rename Total_tax Total_tax1
rename govt_transfer govt_transfer1
rename Unpaid_bills Unpaid_bills1
rename gov_expenditure gov_expenditure1
merge experiment using "Temp\Table_UHI.dta"
drop _merge	
sort experiment
save "Temp\Table_UHI.dta", replace	
}


* Fifth panel: Gov revenue and expenditures per HH
qui{
clear 
use "Counterfactuals Stata Files/Counterfactual16.dta"
replace experiment=0 if experiment==16
append using "Counterfactuals Stata Files/Counterfactual23.dta"

* how much revenue from UHI premiums
gen UHI_premium=0
replace UHI_premium = 810  if age<65 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5)

gen expenditures = Expenditures_pay if (I_treat==1 & I_pay==1) | type2==1 
replace expenditures = Expenditures_not_pay if I_pay==0
sum expenditures
* expenditures = OOP + tax paid + premiums
* first subtract premiums
*has ESHI: benchmark and experiment the same
gen Income_tax= expenditures
replace Income_tax= expenditures - 810 if age<=64 &  (offer_accepted==3 | offer_accepted==5) &  Spouse_status!=3 // has eshi and spouse not covered or no spouse. 
replace Income_tax= expenditures - 2071 if age<=64 & (offer_accepted==3 | offer_accepted==5) &  Spouse_status==3
* experiment
replace Income_tax= expenditures - 810 if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) &  Spouse_status!=3
replace Income_tax= expenditures - 810*2 if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) &  Spouse_status==3
* now subtract the spouse's OOP
replace Income_tax= Income_tax-OOP_spouse if married==1
* now subtract own OOP - only for those who treat and pay. 
replace Income_tax= Income_tax - OOP if type2==1 | (I_treat==1 & I_pay==1) //these always pay

gen Cons_tax = consumption * .057
gen Total_tax = Income_tax + Cons_tax

* now let's fix the 65+
replace expenditures=0 if age>64
replace Income_tax=0 if age>64 
replace Cons_tax=0 if age>64
replace Total_tax=0 if age>64

replace expenditures = Expenditures_pay if age>64
gen Mcare_premium = 854  if age>64
replace Mcare_premium = Mcare_premium + 854 if age>64 & married==1 
replace Mcare_premium =0 if age<65

replace Income_tax=expenditures - Mcare_premium - OOP if age>64 & married==0
replace Income_tax=expenditures - Mcare_premium - OOP - OOP_spouse  if age>64 & married==1

replace Cons_tax = consumption * .057 if age>64
replace Total_tax = Income_tax + Cons_tax if age>64

replace SS_income =0 if age<65
gen total_SS_income = SS_income + spouse_income if age>64 & married==1
replace total_SS_income = SS_income if age>64 & married==0
replace total_SS_income =0 if age<65

gen Mcare_bills= 0 if age<65
replace Mcare_bills=OOP if age>64 & married==0
replace Mcare_bills=OOP + OOP_spouse if age>64 & married==1

* USE BUDGET CONSTRAINT TO INFER TOTAL GOVT EXPENDITURES FOR EACH PERSON. THIS WILL BE THE SUM OF EVERYTHING
* 65+ PEOPLE
* A' + C -RA + ME = SS - MEDICARE_PREM - INCOME_TAX - C(TAX) + ME (1-MEDICARE_COPAY) + TR
* EVERYTHING ON THE RIGHT HAND SIDE IS GOVT TRANSFERS AND REVENUE FROM THIS THIS PERSON
gen gov_expenditure= assets_prime + consumption + OOP*2 + OOP_spouse*2 - 1.045*assets if age>=65 // cons is after tax. OOP*2 is the total medical expendiure of the old. Medicare pays half by assumption. 

replace spouse_income=0 if spouse_income==.
replace I_treat=1 if type2==1
replace I_pay=1 if type2==1 & ESHI==1 
replace I_pay=1 if type2==1 & ESHI==0 & experiment==23 

* for those <65. 
* In the benchmark, we need to worry about ESHI and ESHI premiums
* add the ESHI premium to expenditures = 810
* ESHI premium for couples is 2071
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse - 1.045*assets - earnings - spouse_income if age<=64 & experiment==0 & (offer_accepted!=3 & offer_accepted!=5) // NO INSURANCE, BENCHMARK
* the following 3 lines are for those with ESHI, which are the same in benchmark and UHI experiment, so we run them for both. If anyone is also on Medicaid, that's OK because Medicaid would only pay the OOP part after ESHI paid.
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + 810  - 1.045*assets - earnings if age<=64  & (offer_accepted==3 | offer_accepted==5) & married==0 
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse +  810  - 1.045*assets - earnings - spouse_income if age<=64 & (offer_accepted==3 | offer_accepted==5) &  Spouse_status==2
replace gov_expenditure= assets_prime + consumption + OOP*I_treat + OOP_spouse + 2071 - 1.045*assets - earnings - spouse_income  if age<=64  & (offer_accepted==3 | offer_accepted==5) & married==1 & Spouse_status==3

* UNINSURED IN EXPERIMENT
* experiment with UHI - now have to include total expenditures rather than OOP
* NOTE WE DON'T WANT TO SUBTRACT THE UHI PREMIUMS BECAUSE WE WANT THESE PREMIUMS TO COUNT AS PART OF THE GOV REVENUE
* no ESHI
* singles
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05  - 1.045*assets - earnings if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==0
* married
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05 + OOP_spouse  - 1.045*assets - earnings - spouse_income if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==1 &  Spouse_status==2  // spouse does not work
replace gov_expenditure= assets_prime + consumption + MC_orig*.6*I_treat*1.05 + OOP_spouse + 810 - 1.045*assets - earnings - spouse_income if age<=64 & experiment==23 & (offer_accepted!=3 & offer_accepted!=5) & married==1 &  Spouse_status==3  // spouse works



* GENERATING THINGS FOR TABLE IN PAPER
* BOTTOM PANEL
* TAX REVENUE ; SS+medicare - medicare premiums 
gen SS_Medicare =Mcare_premium -Mcare_bills-total_SS_income


gen Unpaid_bills=0
replace Unpaid_bills=OOP if tr_pay_alt==3 & age<65
* in the benchmark, for those with ESHI, the unpaid part is only the OOP (ESHI always pays the rest). for those without ESHI, OOP is set to .6*MC. 
* in the experiment, it's the same for those with ESHI. If no ESHI, the unpaid part is just the OOP of the person. the rest gets paid by UHI

* UHI
gen UHI=0
replace UHI=MC_orig *.6 *1.05- OOP if ((I_treat==1 & ESHI==0) | (type2==1 & ESHI==0 ) ) & experiment==23 & age<65
gen UHI_total= UHI- UHI_premium

collapse (mean) Total_tax SS_Medicare govt_transfer UHI_total Unpaid_bills gov_expenditure, by(experiment)
* OPEN DATA 
* THESE ARE THE NUMBERS IN THE BOTTOM PANEL OF THE TABLE (transposed)
sort experiment
merge experiment using "Temp\Table_UHI.dta"	
drop _merge
sort experiment
save "Temp\Table_UHI.dta", replace	
}

clear
use "Temp\Table_UHI.dta"

order experiment col8  col3 col4 col5 col6  total  col7 I_treat I_shock I_Good max_age  wage_offer employed_yn yrs_work earnings_PV CV_earn family_consumption_PV CV_cons  TR Total_tax1 UHI_premium UHI govt_transfer1  Unpaid_bills1 gov_expenditure1  Total_tax SS_Medicare govt_transfer UHI_total Unpaid_bills gov_expenditure

xpose, clear
drop if v1==0 & v2==23
drop v1
rename v2 Public_HI

* OPEN DATA -- COPY PASTE INTO TABLE 95 - we need only the last column as the other 2 columns are the same as in Table 8 in the paper

}
